<style lang="scss">
  .picImg {
    width: 40px;
    height: 40px;
  }
  .el-upload-list--picture .el-upload-list__item-name {
    width: 100px;
  }
  .avatar-uploader .el-upload {
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }
  .avatar-uploader .el-upload:hover {
    border-color: #20a0ff;
  }
  .avatar-uploader-icon {
    font-size: 28px;
    color: #8c939d;
    width: 270px;
    height: 190px;
    line-height: 200px;
    text-align: center;
  }
  .avatar {
    width: 270px;
    height: 190px;
    display: block;
  }
  .commission-i {
    width: 6px;
    height: 24px;
    background-color: #ff8200;
    border-radius: 3px;
    vertical-align: -4px;
  }
  /*.el-menu-item:hover{
    color: #409EFF;
  }*/
  .el-menu-item.is-active, .el-menu-item:hover{
    background-color: #fff !important;
    color: #409EFF;
  }
  .el-menu-item, .el-submenu__title{
    height: 65px;
    line-height: 25px;
    white-space: normal;
    padding: 10px 20px;
  }
</style>
<template>
  <div class="dashboard-editor-container" :style="{backgroundImage: 'url(' + bgImg + ')' }">
    <div class="app-container">
      <!--&lt;!&ndash; 查询和其他操作 &ndash;&gt;-->
      <div class="filter-container">

        <!--<div class="top">
          <span v-if="id == 1">银行签约列表页</span>
          <span v-else>票据贴现列表页</span>
          <router-link to="/dashboard">
            &lt;!&ndash;<img style="width:23px;height:100%;" src="../../assets/xiazai44.png" alt="">&ndash;&gt;
            <i class="el-icon-back"></i>
            返回
          </router-link>
        </div>-->
        <topback title="银行签约列表页" v-if="id == 1"/>
        <topback title="票据贴现列表页" v-else/>

        <div class="div_flex">
          <div class="enterprise" v-if="!uicod">
            <div class="commission-i"></div>
            <span>企业名称</span>
          </div>
          <div class="information" style="text-align: center">
            <div class="commission-i"></div>
            <span>企业基本信息</span>
          </div>
        </div>

        <div class="handle-add">
          <!--左侧公司名称-->
          <el-menu
            :default-active="navselected"
            :active="navselected"
            class="el-menu-vertical-demo">
            <div v-for="(items, index) in menuList" :key="index" @click="getNavType(items.code,items.name)">
              <el-menu-item :index="index+''" style="font-size: 17px;" v-if="items.code == unifiedCode">
                <span slot="title">{{ items.name }}</span>
              </el-menu-item>
              <el-menu-item :index="index+''" style="font-size: 17px;" v-if="unifiedCode == null">
                <span slot="title">{{ items.name }}</span>
              </el-menu-item>
            </div>
          </el-menu>
          <div style="width: 100%;padding-left: 15px;">
            <!--公司详细信息-->
            <el-form ref="compinfo" :model="compinfo" status-icon label-position="left"
                     label-width="110px" style="width: 100%; display: flex;padding-bottom: 30px">
              <div style="flex: 1;margin-left: 15px">
                <el-form-item label="中征码：" style="margin-bottom: 0">
                  <span>{{ compinfo.loanCardNo }}</span>
                </el-form-item>
                <el-form-item label="公司名称：" style="margin-bottom: 0">
                  <span>{{ compinfo.companyName }}</span>
                </el-form-item>
                <el-form-item label="统一信用代码：" style="margin-bottom: 0">
                  <span>{{ compinfo.unicode }}</span>
                </el-form-item>
              </div>
              <div style="flex: 1">
                <el-form-item label="法人姓名：" style="margin-bottom: 0">
                  <span>{{ compinfo.legalName }}</span>
                </el-form-item>
                <el-form-item label="法人手机号：" style="margin-bottom: 0">
                  <span>{{ compinfo.legalMobile }}</span>
                </el-form-item>
                <el-form-item label="法人证件号码：" style="margin-bottom: 0">
                  <span>{{ compinfo.legalID }}</span>
                </el-form-item>
              </div>
            </el-form>

            <form style="display: flex;width: 100%">
              <!--查询贴现利率-->
              <div style="width: 51%" v-if="id == 2">
                <el-form ref="userInfo" :rules="userInfoRules" :model="userInfo" status-icon label-position="left"
                         label-width="150px" style="width: 100%;padding-right: 18px;">
                  <el-form-item label="承兑行：" prop="acceptBankNo">
                    <el-select v-model="userInfo.acceptBankNo" filterable style="width: 100%">
                      <el-option
                        v-for="item in unionnos"
                        :key="item.interBankNo"
                        :label="item.bankName"
                        :value="item.interBankNo"></el-option>
                    </el-select>
                  </el-form-item>
                  <el-form-item label="贴现日期：" prop="applyDate">
                    <el-date-picker
                      style="width:100%"
                      v-model="userInfo.applyDate"
                      type="date"
                      placeholder="贴现日期"
                      value-format="yyyy/MM/dd">
                    </el-date-picker>
                  </el-form-item>
                  <el-form-item label="票面到期日：" prop="dueDate">
                    <el-date-picker
                      style="width: 100%"
                      v-model="userInfo.dueDate"
                      type="date"
                      placeholder="票面到期日"
                      value-format="yyyy/MM/dd">
                    </el-date-picker>
                  </el-form-item>
                  <el-form-item label="票面金额（元）：" prop="faceAmount">
                    <el-input v-model="userInfo.faceAmount" auto-complete="off" placeholder="最大金额500万"/>
                  </el-form-item>
                  <el-form-item>
                    <el-button
                      type="primary"
                      style="width: 50%"
                      @click="ratesearchList"
                      v-loading.fullscreen.lock="fullscreenLoading">
                      查询贴现利率
                    </el-button>
                  </el-form-item>
                </el-form>
              </div>

              <div style="width: 51%" v-if="id == 1">
                <!--签约银行-->
                <el-form ref="sigingInfo" :rules="sigingInfoRules" :model="sigingInfo" status-icon label-position="right"
                         label-width="150px" style="width: 100%;">
                  <el-form-item label="签约银行：" prop="bankCode">
                    <el-select v-model="sigingInfo.bankCode" placeholder="请选择" style="width:80%" @change="bankNameChange">
                      <el-option value="0000" label="富民银行">富民银行</el-option>
                      <el-option value="0001" label="网商银行">网商银行</el-option>
                      <el-option value="0002" label="振兴银行">振兴银行</el-option>
                    </el-select>
                    <el-alert
                      v-if="sigingInfo.bankCode == '0001' || sigingInfo.bankCode == '0002'"
                      style="background-color: #fff;padding: 0;width: 50%"
                      title="即将上线"
                      type="error"
                      :closable="false">
                    </el-alert>
                  </el-form-item>
                  <el-form-item label="协议签署页扫描件：" prop="agreement" v-if="sigingInfo.bankCode == '0000'">
                    <el-upload
                      style="width: 81%"
                      class="upload-demo"
                      ref="upload"
                      action="string"
                      :before-upload="beforeUploadFile"
                      :http-request="dosigningUpload"
                      :file-list="fileList"
                      :limit="1"
                      name="agreement"
                      list-type="picture"
                      accept=".jpg,.jpeg,.png,.JPG,.JPEG,.PBG,"
                      :auto-upload="false">
                      <el-button size="small" type="primary" style="width: 100%">点击上传
                      </el-button>
                      <div slot="tip" class="el-upload__tip">图片文件（jpg、png、jpeg），2M以内</div>
                    </el-upload>
                    <!--<el-upload
                      ref="upload"
                      action="string"
                      :show-file-list="false"
                      :before-upload="beforeUploadFile"
                      :http-request="dosigningUpload"
                      :on-success="uploadAvatar"
                      class="avatar-uploader"
                      name="agreement"
                      accept=".jpg,.jpeg,.png,.JPG,.JPEG,.PBG,">
                      <img v-if="sigingInfo.agreement" :src="sigingInfo.agreement" class="avatar">
                      <i v-else class="el-icon-upload avatar-uploader-icon"/>
                    </el-upload>-->
                  </el-form-item>
                  <el-form-item>
                    <el-button
                      v-if="sigingInfo.bankCode != '0000'"
                      type="primary"
                      @click="dosigningUpload"
                      style="width: 30%"
                      :disabled="sigingInfo.bankCode == '0001' || sigingInfo.bankCode == '0002'">
                      {{ accountStatus }}
                    </el-button>
                    <el-button
                      v-else
                      type="primary"
                      @click="$refs.upload.submit()"
                      style="width: 30%"
                      :disabled="sigingInfo.bankCode == '0001' || sigingInfo.bankCode == '0002'">
                      {{ accountStatus }}
                    </el-button>
                  </el-form-item>
                  <div style="text-align: center;padding: 20px 0 20px 0;" v-if="sigingInfo.bankCode == '0000'">
                    <el-button type="success" style="width: 35%" @click="agreementDownload" plain>
                      协议下载
                    </el-button>
                  </div>
                </el-form>
              </div>
              <!--右侧银行状态-->
              <el-form style="width: 48%;">
                <div class="bacnk_fon" v-for="(item, index) in bankCodeList">
                <!--<div class="bacnk_fon" v-for="(item, index) in unicodeList">-->
                  <!--银行名称-->
                  <div class="font-cs">
                    <div style="display: flex;line-height: 30px">
                      <div class="commission-i" style="height: 20px;width:4px;margin-top: 6px"></div>
                      <a style="padding-left: 6px">{{ item.label }}</a>
                      <el-button type="warning"
                                 v-if="item.status == '0'"
                                 size="small"
                                 style="margin-left: 8px"
                                 @click="voucherPrinting(item)">凭证打印
                      </el-button>
                    </div>

                    <div class="font-div" v-if="item.bankCodeListbol && ratesList.length != 0">
                      <el-button type="success" style="text-align: center" @click="discount">查看网银贴现</el-button>
                    </div>
                  </div>

                  <!--银行签约状态-->
                  <div class="button_cs" v-if="!item.bankCodeListbol || ratesList.length == 0">
                    <div class="siging-font">
                      <span>{{ item.status | statusFilter }}</span>
                    </div>
                  </div>
                  <!-- <div class="button_cs"  v-if="!item.bankCodeListbol">
                   <div class="siging-font" v-if="item.value == items.bankCode">
                      <span>{{ items.status | statusFilter }}</span>
                    </div>
                    <div class="siging-font" v-else>
                      <span>未签约</span>
                    </div>
                  </div>-->
                  <!--银行利率-->
                  <div class="button_cs" v-else>
                    <el-form-item label="贴现利率(%)：" style="margin: 0" v-if="userInfoList.chkResult != '000000'">
                      <span>{{ item.billRate }}</span>
                    </el-form-item>
                    <el-form-item label="实付金额(元)：" style="margin: 0" v-if="userInfoList.chkResult != '000000'">
                      <span>{{ item.realMoney }}</span>
                    </el-form-item>
                    <el-form-item label="贴现利息(元)：" style="margin: 0" v-if="userInfoList.chkResult != '000000'">
                      <span>{{ item.interest }}</span>
                    </el-form-item>
                    <el-form-item label="查询结果：" style="margin: 0" v-else>
                      <span>{{ item.chkResult | chkResultFilte }}</span>
                    </el-form-item>
                  </div>
                </div>
              </el-form>
            </form>
          </div>

          <!--网银直贴弹窗-->
          <el-dialog :visible.sync="signingVisible" title="网银贴现信息" :close-on-click-modal="false">
            <el-alert
              title="温馨提示：请到网银进行直贴请求！"
              type="warning"
              show-icon
              :closable="false"/>
            <el-form ref="signingForm" :model="signingForm" status-icon label-position="left" label-width="150px"
                     v-for="item in bankCodeList" :key="item.value" style="margin-left:20px;padding-top: 30px;">

              <div style="display: flex;">
                <div v-if="item.value == '0000'">
                  <el-form-item label="贴入行名称：" style="margin-bottom: 0">
                    <span>重庆富民银行股份有限公司</span>
                  </el-form-item>
                  <el-form-item label="贴入人大小额行号：" style="margin-bottom: 0">
                    <span>323653010015</span>
                  </el-form-item>
                  <el-form-item label="贴入人账号：" style="margin-bottom: 0">
                    <span>0</span>
                  </el-form-item>
                  <el-form-item label="清算方式：" style="margin-bottom: 0">
                    <span>线下清算</span>
                  </el-form-item>
                  <el-form-item label="贴现种类：" style="margin-bottom: 0">
                    <span>买断式</span>
                  </el-form-item>
                </div>
                <!--<div v-if="item.value == '0001'">
				          <el-form-item label="贴入行名称：">
				        	  <span>辽宁振兴银行股份有限公司</span>
				          </el-form-item>
				          <el-form-item label="贴入人大小额行号：">
				        	  <span>3233221000086</span>
				          </el-form-item>
				          <el-form-item label="贴入人账号：">
				        	  <span>0</span>
				          </el-form-item>
				        </div>-->
                <div style="padding-left: 65px;" v-if="item.bankCodeListbol">
                  <el-form-item label="贴现利率（%）：" style="margin: 0" v-if="userInfoList.chkResult != '000000'">
                    <span>{{ item.billRate }}</span>
                  </el-form-item>
                  <el-form-item label="实付金额（元）：" style="margin: 0" v-if="userInfoList.chkResult != '000000'">
                    <span>{{ item.realMoney }}</span>
                  </el-form-item>
                  <el-form-item label="贴现利息（元）：" style="margin: 0" v-if="userInfoList.chkResult != '000000'">
                    <span>{{ item.interest }}</span>
                  </el-form-item>
                  <el-form-item label="查询结果：" style="margin: 0" v-else>
                    <span>{{ item.chkResult | chkResultFilte }}</span>
                  </el-form-item>
                  <p style="width:200px;color: #C03639"><b>结算金额（贴现实际获得金额）= 票面金额 - 票面金额 * 贴现利率 * 贴现天数/360</b></p>
                </div>
              </div>
            </el-form>
            <div slot="footer" class="dialog-footer">
              <el-button @click="signingVisible = false">取消</el-button>
            </div>
          </el-dialog>

        </div>

      </div>
    </div>
    <!--<div style="background: #000;height: 120px;"></div>-->
  </div>
</template>

<script>
import {doGet, doPost, doFile} from '@/api'
import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
import bgImg from '../../assets/xh-bg.jpg'
import Topback from './topback'

let fd = new FormData()
export default {
  name: 'bank',
  codes: '',
  values: '',
  compinfUnicode: '',     //公司统一信用代码
  enterpriseName: '',
  enterprise: '',

  components: {
    Pagination,
    Topback
  },
  filters: {
    chkResultFilte(val) {
      return {
        '000000': '可以贴现',
        '000001': '合作平台额度超限',
        '000002': '承兑行额度超限',
        '000003': '企业额度超限',
        '000004': '不支持此承行',
        '000005': '没有找到对应的利率',
      }[val]
    },
    bankCodeFilter(val) {
      return {
        '0000': '富民银行',
        '0001': '网商银行',
        '0002': '振兴银行',
      }[val]
    },
    statusFilter(val) {
      return {
        '0': '签约成功',
        '1': '待审核',
        '2': '已驳回',
        '3': '历史客户,已开户',
        '4': '审核中',
        '-1': '失败'
      }[val] || '未签约'
    }
  },
  data() {
    const faceAmountValidate = (rule, value, callback) => {
      if (value > 5000000) {
        callback(new Error('票面金额不能大于500 0000'))
      } else {
        callback()
      }
    }
    return {
      bgImg: bgImg,
      dialogImageUrl: '',
      list: [],
      unionnos: [],    //弹窗分行数组
      fileList: [],     //上传文件
      unicodeList: [],    //查询签约结果列表
      compinfoList: [],   //获取公司列表
      ratesList: [],        //获取贴现利率列表
      bankCodeList: [
        {
          value: '0000',
          label: '富民银行',
          bol: false,           //判断显示未签约
          sigingfont: '未签约',
          chkResult: '',
          billRate: '',
          realMoneyl: '',
          interest: '',
          status: undefined,
          bankCodeListbol: false      //判断显示已签约
        },
        {
          value: '0001',
          label: '网商银行',
          bol: false,
          sigingfont: '未签约',
          chkResult: '',
          billRate: '',
          realMoneyl: '',
          interest: '',
          status: undefined,
          bankCodeListbol: false
        },
        {
          value: '0002',
          label: '振兴银行',
          bol: false,
          sigingfont: '未签约',
          chkResult: '',
          billRate: '',
          realMoneyl: '',
          interest: '',
          status: undefined,
          bankCodeListbol: false
        },
      ],
      listQuery: {
        pageNum: 1,
        pageSize: 20,
      },
      editForm: {
      },
      userInfo: {
        acceptBankNo: undefined,
        faceAmount: undefined,
        dueDate: undefined,
        applyDate: undefined
      },
      userInfoList: [],
      userInfoRules: {
        acceptBankNo: [{ required: true, message: '承兑行行号不允许为空', trigger: 'blur' }],
        faceAmount: [
          { required: true, message: '票面金额不允许为空', trigger: 'blur' },
          { validator: faceAmountValidate, trigger: 'blur' }
        ],
        dueDate: [{ required: true, message: '票面到期日不允许为空', trigger: 'blur' }],
        applyDate: [{ required: true, message: '贴现日期不允许为空', trigger: 'blur' }],
      },
      sigingInfo: {
        bankCode: undefined
      },
      compinfo: {
        unicode: undefined,
        companyName: undefined,
        loanCardNo: undefined,
        legalName: undefined,
        legalID: undefined,
        legalMobile: undefined
      },
      sigingInfoRules: {
        bankCode: [{ required: true, message: '签约银行不允许为空', trigger: 'blur' }]
      },
      signingForm: {
      },
      menuIndex: undefined,
      menuList: [],
      navselected: '0',
      signingVisible: false,
      buttonsss: false,
      content: false,
      id: undefined,
      agreement: '',
      uicod: undefined,
      fullscreenLoading: false,
      dialogVisible: false,
      accountStatus: '签约',
      status: undefined,
      bankCodes: undefined,
      unifiedCode: undefined,
    }
  },
  watch: {
    '$store.state.menuIndex': 'getNavType',
    compinfo: {
      handler: function(val) {
        if (this.id == 1 && this.unifiedCode != null) {
          for (var item of this.compinfoList) {
            if (item.unicode == this.unifiedCode) {
              this.compinfo = item
            }
          }
        }
      },
      deep: true
    }
  },
  created() {
    this.getList()
    this.getUnioLs()
    // this.getUnigo()
    //  获取id
    if (this.$route.query.id == null) {
      return
    }
    this.id = this.$route.query.id
    //  获取unicode
    if (this.$route.query.unicode == null) {
      return
    }
    this.unifiedCode = this.$route.query.unicode
  },
  methods: {
    handlePictureCardPreview(file) {
      this.dialogImageUrl = file.url
      this.dialogVisible = true
    },
    // 贴现利率查询
    ratesearchList() {
      this.$refs['userInfo'].validate(valid => {
        if (valid) {
          this.buttonsss = false
          this.fullscreenLoading = true
          let tds
          if (this.codes == null) {
            tds = this.compinfUnicode
          } else {
            tds = this.codes
          }
          let sendData = {
            ...this.userInfo,
            unicode: tds
          }
          doGet('ratesearch.html?op=search', sendData).then(response => {
            this.ratesList = response.rows
            if (response.rows.length == 0) {
              this.$notify.info({
                title: '消息',
                message: '未查到数据'
              })
            }
            for (var item of response.rows) {
              this.bankCodeList.some((val) => {
                if (val.value == item.bankCode) {
                  val.chkResult = item.chkResult
                  val.billRate = item.billRate
                  val.realMoney = item.realMoney
                  val.interest = item.interest
                  val.bankCodeListbol = true
                }
              })
            }
            this.fullscreenLoading = false
          }).catch(response => {
            this.$notify.error({
              title: '失败',
              message: response.message
            })
            this.fullscreenLoading = false
          })
        }
      })
    },
    // 获取公司信息列表
    getList() {
      doPost('company.html?op=list', {}).then(response => {
        this.compinfoList = response.rows
        if (this.compinfoList.length != 0) {
          this.compinfUnicode = this.compinfoList[0].unicode
          this.enterpriseName = this.compinfoList[0].companyName
          if (this.id == 1 && this.unifiedCode != null) {
            this.getUnigo(this.unifiedCode)
          } else {
            this.getUnigo(this.compinfUnicode)
          }
          if (this.navselected == '0') {         //左侧菜单默认显示
            this.compinfo = this.compinfoList[0]
          }
        }
        for (var item of response.rows) {
          this.menuList.push({
            name: item.companyName,
            code: item.unicode
          })
        }
      }).catch(response => {
        this.$notify.error({
          title: '失败',
          message: response.message
        })
      })
    },
    selectItems(index) {
      this.$store.state.menuIndex = index
    },
    getUnigo(unicode) {
      doGet('company.html?op=signresult', { unicode: unicode }).then(response => {
        this.unicodeList = response.rows
        for (var item of response.rows) {
          this.status = item.status
          this.bankCodes = item.bankCode
          this.bankCodeList.some((val) => {
            if (val.value == item.bankCode) {
              val.status = item.status
              val.bol = true
              /*val.sigingfont = '已签约'*/
            }
          })
        }
      }).catch(() => {
        this.unicodeList = []
      })
    },
    // 点击左侧菜单 判断显示已签约和未签约
    getNavType(code, company) {
      this.codes = code
      this.enterprise = company
      let fd
      if (this.unifiedCode != null) {
        fd = this.unifiedCode
      } else {
        fd = this.codes
      }
      if (this.$refs['userInfo'] !== undefined) {       //  清除表单数据
        this.$refs['userInfo'].resetFields()
      }
      if (this.$refs['sigingInfo'] !== undefined) {
        this.$refs['sigingInfo'].resetFields()
      }
      for (var item of this.compinfoList) {
        if (item.unicode == this.codes) {
          this.compinfo = item
        }
      }
      doGet('company.html?op=signresult', { unicode: fd }).then(response => {
        this.unicodeList = response.rows
        for (var backcode of this.bankCodeList) {
          backcode.sigingfont = '未签约'
          backcode.bol = false
          backcode.status = undefined
        }

        for (var item of response.rows) {
          this.status = item.status
          this.bankCodes = item.bankCode
          this.bankCodeList.some((val) => {
            if (val.value == item.bankCode) {
              val.status = item.status
              val.bol = true
              //val.sigingfont = '已签约'
            }
          });
        }
      }).catch(() => {
        this.unicodeList = []
      })
    },
    /*分行弹窗显示*/
    getUnioLs() {
      doGet('bank.html?op=list').then(response => {
        this.unionnos = response.rows
      }).catch(() => {
        this.unionnos = []
      })
    },
    /**贴现弹窗*/
    discount() {
      this.signingVisible = true
    },
    /**上传图片*/
    beforeUploadFile(file) {
      this.file = file;
      let extension = file.name.substring(file.name.lastIndexOf('.') + 1)
      let size = file.size / 1024 / 1024 <= 2
      if (extension !== 'jpg' && extension !== 'png' && extension !== 'jpeg' && extension !== 'JPG' && extension !== 'PNG') {
        this.$notify.warning({
          title: '警告',
          message: `只能上传png（即后缀是.jpg或.png）的图片`
        })
        return false
      }
      if (!size) {
        this.$notify.error({
          title: '失败',
          message: `请上传小于2MB的图片`
        })
        return false
      }
    },
    dosigningUpload(param) {
      if (this.compinfoList.length == 0) {
        this.$notify.warning({
          title: '警告',
          message: '您还没有添加企业哦！不能对此页面进行操作!'
        })
        return false
      }
      this.$refs['sigingInfo'].validate(valid => {
        if (valid) {
          fd = new FormData()
          fd.append('agreement', param.file)    // 上传文件
          fd.append('bankCode', this.sigingInfo.bankCode)
          if (this.uicod == undefined && this.codes == undefined) {
            fd.append('unicode', this.compinfUnicode)   //首页点击获取
          } else if (this.uicod == undefined) {
            fd.append('unicode', this.codes)            //从本页点击左侧菜单面获取
          } else if (this.codes == undefined) {
            fd.append('unicode', this.uicod)            //从企业信息页面获取
          }
          fd.append('op', `${this.accountStatus == '签约' ? 'sign' : 'resign'}`)
          doPost('company.html', fd).then(response => {
            this.$notify.success({
              title: '成功',
              message: this.accountStatus == '签约' ? '操作成功' : '重新签约提交成功'
            })
            if (this.$refs['sigingInfo'] !== undefined) {
              this.$refs['sigingInfo'].resetFields()
            }
          }).catch(response => {
            this.$notify.error({
              title: '失败',
              message: response.message
            })
          })
        }
      })
    },
    /**切换按钮*/
    bankNameChange() {
      for (var item of this.unicodeList) {
        if (this.sigingInfo.bankCode == item.bankCode && item.status == '2') {
          this.accountStatus = '重新签约'
        }
      }
    },
    /**协议下载*/
    agreementDownload() {
      var url ='http://www.piaojupingtai.com/'
      /*url += 'downLoad.html?bankCode=' + this.sigingInfo.bankCode + '&op=download'*/
      url += 'downLoad.html?op=download&' + this.sigingInfo.bankCode
      window.open(url)
    },
    //    凭证打印
    voucherPrinting(row) {
      var name;
      var cerid;
      if (this.codes == undefined && this.enterprise == undefined) {
        name = this.enterpriseName
        cerid = this.compinfUnicode
      } else {
        cerid = this.codes
        name = this.enterprise
      }
      let sendData = {
        bankCode: row.value,
        enterpriseName: name,
        certId: cerid
      }
      doGet('company.html?op=voucher', sendData ).then(response => {
        this.data = response.data.voucherPrintUrl
        // this.data.replace('C:/data/pdf/', 'www.baojin.vip/pdf/')
        // var toUrl = this.data.replace('C:/data/pdf/', 'pdf/')
        window.open(this.data)
      }).catch(response => {
        this.$notify.error({
          title: '失败',
          message: response.message
        })
      })
    },
  }
}
</script>
<style lang="scss" scoped>
  .dashboard-editor-container {
    padding: 200px 0px 0px;
    background-color: #f7f7f7;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;

    .chart-wrapper {
      background: #fff;
      padding: 16px 16px 0;
      margin-bottom: 32px;
    }
  }
  .app-container{
    .div_flex {
      display: flex;
      padding: 30px 30px 10px;
      font-size: 20px;
      font-weight: 700;
      .enterprise {
        display: flex;
        width: 24%;
        span {
          padding-left: 10px;
        }
      }
      .information {
        display: flex;
        width: 70%;
        span {
          padding-left: 10px;
        }
      }
    }
    .handle-add {
      padding: 20px 20px 30px 20px;
      display: flex;
      .el-menu-vertical-demo {
        border: 0;
        width:30%;
        overflow: hidden;
        font-weight: 700;
        background-color: rgba(64, 158, 255, 0.11);
      }
      .bacnk_fon {
        display: flex;
        width: 100%;
        height: 120px;
        margin-bottom: 16px;
        box-shadow: 0 0 24px 0 #eee;
        .font-cs {
          flex: 1;
          font-size: 18px;
          font-weight:bold;
          padding: 20px 0 20px 20px;
          .font-div {
            padding: 25px 0 20px 0;
          }
        }
        .button_cs {
          flex: 1;
          display: inline;
          text-align: right;
          margin: 0;
          padding: 15px 8px 0 0;
          .siging-font {
            width: 68%;
            height:30px;
            border: 1px solid #4E95FA;
            line-height: 25px;
            text-align: center;
            font-size: 14px;
            font-weight: bold;
            border-radius: 3px;
          }
        }
      }
    }
  }
  .top {
    text-align: justify;
    padding: 10px 20px 9px 40px;
    font-size: 16px;
    border-bottom: 1px solid #eee;
    span {
      margin-right: 85%;
    }
  }
  .dialog-footer {
    margin-left:200px;
  }
</style>
